package com.cn.designpatterns.ex.concrete.singleton;

import java.util.Objects;

/**
 * @author zhangyi
 * @date 2018/12/24 9:22
 */
public class LazySingleton {
    private static LazySingleton lazySingleton;

    private LazySingleton(){}

    public static LazySingleton getInstance(){
        if(Objects.isNull(lazySingleton)){
            lazySingleton = new LazySingleton();
            return lazySingleton;
        }else{
            return lazySingleton;
        }
    }
}
